                                             
/*
 * PurchaseOrderBO.java
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

//package edu.byu.isys413.pb88.data;
package finalintex2web;
import java.util.LinkedList;
import java.util.List;

/**
 *
 * @author Prabol Bhandari
 */
public class PurchaseOrderBO {
    
    private List<OrderLineBO> orderlines = new LinkedList();
    private boolean dirty = false;
    private boolean alreadyInDB = false;
    private String poguid;
    private VendorBO vendor;
    
    /** Creates a new instance of PurchaseOrderBO */
    public PurchaseOrderBO(String id) {
        this.poguid = id;
    }
    /*@return orderlines of type OrderLine
     *gets the order line
     */
    public List<OrderLineBO> getOrderlines() {
        return orderlines;
    }
    
    /*@param orderlines of type OrderLine
     *Sets the order line
     */
    public void setOrderlines(List<OrderLineBO> orderlines) {
        this.orderlines = orderlines;
        this.dirty = true;
    }
    /**
     * This method enables us to know if the object is dirty. If the object is dirty then we need to update it in the database.
     *If the object is not dirty then we dont need to update the object in the database.
     * @return 
     */
    public boolean isDirty() {
        return dirty;
    }
    /**
     * 
     * @param dirty 
     * Sets the object as dirty or not dirty depending on the parameter passed.
     */
    public void setDirty(boolean dirty) {
        this.dirty = dirty;
    }
     /**
     * @return boolean indb 
     * This method is to check if this object is already set in the database or not.
     *
     */

    public boolean isAlreadyInDB() {
        return alreadyInDB;
    }
     /**
     * @param indb
     * Sets the indb variable to whatever is passed in indb.
     *This method is to tell the object that this object has already been saved or not saved in the database. 
     */
    public void setAlreadyInDB(boolean alreadyInDB) {
        this.alreadyInDB = alreadyInDB;
    }

    public String getPoguid() {
        return poguid;
    }

    public VendorBO getVendor() {
        return vendor;
    }

    public void setVendor(VendorBO vendor) {
        this.vendor = vendor;
    }
    
}